from flask_restful import Api
from  flask import Blueprint
from comment.utils.output import output_json

user_bp = Blueprint('user',__name__,url_prefix='/user')  #创建蓝图

user_api =  Api(user_bp)

#使用定制好的返回到前端格式json
user_api.representation('application/json')(output_json)

#加载蓝图中的所有资源
from financial.resource.user.user_resource import *

user_api.add_resource(Login,'/login',endpoint='login')  #这是登录的资源
user_api.add_resource(LoginOut,'/loginOut',endpoint='loginOut')  #这是退出登录资源
user_api.add_resource(UserAvatar,'/avatar',endpoint='avatar')  #上传用户头像资源
user_api.add_resource(IsExistPhone,'/IsExist',endpoint='IsExist')  #验证手机号是否重复
user_api.add_resource(SmsCode,'/sms',endpoint='sms')  #发送短信验证码的接口
user_api.add_resource(RegisterUser,'/register-user',endpoint='register-user')  #用户注册
user_api.add_resource(Invite,'/invite',endpoint='invite')  #邀请码
